package com.wang.concurrency;

public class ThreadStart {
	
	public static void main(String[] args) {
		
		//继承Thread类来创建线程类时,多个线程之间无法共享线程类的实例变量.
		new ConcreteThread().start();
		new ConcreteThread("second").start();

		for (int i = 0; i < 10; ++i) {
			System.out.println(Thread.currentThread().getName() + ":" + i);
		}		
	}
	

private static class ConcreteThread extends Thread{
	
	
	public ConcreteThread(){
		
	}
	public ConcreteThread(String name){
		super(name);
	}
	
	private int i=0;
		
	
	@Override
	public void run() {
		for(;i<10;i++){
			System.out.println(getName()+" : "+i);			
		}

	}
}	
	
	
}


